/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.modular.xyuser.entity;

import cn.hutool.extra.emoji.EmojiUtil;
import com.baomidou.mybatisplus.annotation.*;
import lombok.NoArgsConstructor;
import vip.xiaonuo.core.pojo.base.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import java.time.LocalDateTime;
import java.time.LocalDate;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
import vip.xiaonuo.modular.xyuser.form.WechatForm;

/**
 * 用户信息
 *
 * @author yanwei
 * @date 2023-05-05 15:44:27
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("xy_user")
@ApiModel("xy_user 实体")
@NoArgsConstructor
public class XyUser extends BaseEntity {

    public XyUser(WechatForm wechatForm){
        this.imgUrl = wechatForm.getAvatarUrl();
        this.openId = wechatForm.getOpenId();
        this.nickName =  EmojiUtil.toAlias(wechatForm.getNickName());
        this.genealogyHost = String.valueOf(System.currentTimeMillis());
    }

    /**
     * 
     */
    @ApiModelProperty("")
    @TableId(type = IdType.ASSIGN_ID)
    private String id;


    /**
     * 
     */
    @Excel(name = "")
    @ApiModelProperty("")
    private String openId;


    /**
     * 微信昵称
     */
    @Excel(name = "微信昵称")
    @ApiModelProperty("微信昵称")
    private String nickName;


    /**
     * 微信头像
     */
    @Excel(name = "微信头像")
    @ApiModelProperty("微信头像")
    private String imgUrl;


    /**
     * 手机号
     */
    @Excel(name = "手机号")
    @ApiModelProperty("手机号")
    private String phoneNumber;


    /**
     * 谱号_唯一标识
     */
    @Excel(name = "谱号_唯一标识")
    @ApiModelProperty("谱号_唯一标识")
    private String genealogyHost;


    /**
     * 是否支持创建家谱
     */
    @Excel(name = "是否能创建族谱,1=不可以,2=可以")
    @ApiModelProperty("是否能创建族谱,1=不可以,2=可以")
    private String isSupport;


}
